package main

import "fmt"

func main() {
	fmt.Printf("%#v", findRepeatedDnaSequences("AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"))
}

/**
 *	findRepeatedDnaSequences
 *	@Description:哈希表
 *	@param s string
 *	@return res []string
 */
func findRepeatedDnaSequences(s string) (res []string) {
	n := len(s)
	m := make(map[string]int, n-10)
	for i, j := 10, 0; i <= n; i, j = i+1, j+1 {
		dna := s[j:i]
		m[dna]++
		if m[dna] > 1 && m[dna] < 3 {
			res = append(res, dna)
		}
	}
	return
}
